package com.qiaotongtianxia.loans.beanManager;

import android.content.Context;

import com.google.gson.Gson;
import com.qiaotongtianxia.loans.bean.Member;
import com.qiaotongtianxia.loans.util.SPUtil;

/**
 * Created by lisen on 2017/12/4.
 *
 * @author lisen < 4533548588@qq.com >
 */

public class MemberManager {
    public static Member getMember(Context context){

        try{
            String json = SPUtil.getString(context,SPUtil.MEMBER,SPUtil.MEMBER_KEY,"");
            Member member = new Gson().fromJson(json,Member.class);
            if (member != null){
                return member;
            }else{
                return new Member();
            }

        }catch (Exception e){
            e.printStackTrace();
        }
        return new Member();
    }
}
